package com.amit.hibernate;

import java.util.List;

public class Lab30 {

	public static void main(String[] args) {
		
		CustomerDAO cdao=DAOFactory.getCustomerDAO();
		
		System.out.println("All customers");
		
		List<Customer> list=cdao.getAllCustomers();
		
		for(Customer c:list)
		{
			System.out.println(c);
		}
		
		
System.out.println("customers by city");
		
		 list=cdao.getCustomersByCity("Bangalore");
		
		for(Customer c:list)
		{
			System.out.println(c);
		}		
		System.out.println("customers by city 0 3");
				
				 list=cdao.getCustomersByCity("Bangalore",1,4);
				
				for(Customer c:list)
				{
					System.out.println(c);
				}
		


				System.out.println("customers by cardType");
						
						 list=cdao.getCustomersByCardType("visa");
						
						for(Customer c:list)
						{
							System.out.println(c);
						}
				
						

						System.out.println("customers by cardType 0 2");
								
								 list=cdao.getCustomersByCardType("visa",0,2);
								
								for(Customer c:list)
								{
									System.out.println(c);
								}
								
								

								System.out.println("customers by bal");
										
										 list=cdao.getCustomersByBal(1233);
										
										for(Customer c:list)
										{
											System.out.println(c);
										}
								

										System.out.println("customers by bal 0 4");
												
												 list=cdao.getCustomersByBal(22,0,3);
												
												for(Customer c:list)
												{
													System.out.println(c);
												}
										
			

												System.out.println("customers by status");
														
														 list=cdao.getCustomersBStatus("old");
														
														for(Customer c:list)
														{
															System.out.println(c);
														}	
														
							System.out.println("customers by status 0 ,3");
														
														 list=cdao.getCustomersBStatus("new",0,3);
														
														for(Customer c:list)
														{
															System.out.println(c);
														}							


														System.out.println("customers by names");
																
																 list=cdao.getCustomersByName("anil");
																
																for(Customer c:list)
																{
																	System.out.println(c);
																}	
																

																System.out.println("customers by city,cardType");
																		
																		 list=cdao.getCustomers("Bangalore","visa");
																		
																		for(Customer c:list)
																		{
																			System.out.println(c);
																		}	
																		
																
																		System.out.println("customers by city,cardType,status");
																		
																		 list=cdao.getCustomers("Bangalore","visa","new");
																		
																		for(Customer c:list)
																		{
																			System.out.println(c);
																		}	
																		
																		
																		System.out.println("customers by emails");
																		
																		 Customer c=cdao.getCustomersByEmail("amit@gmail.com");
																		
																		
																		
																			System.out.println(c);
																			
																			

																			System.out.println("customers by ccno");
																			
																			  c=cdao.getCustomersByCardNo(1233);
																			
																			
																			
																				System.out.println(c);
																			
	}

}
